#ifndef SHORTCUTSETTINGS_H
#define SHORTCUTSETTINGS_H

#include "button.h"
#include <Maestro/database.h>
#include "keycontrollablemenu.h"
#include "keydialog.h"
#include "settingsmenuitem.h"

class ShortcutSettings : public SettingsMenuItem
{
    Q_OBJECT
public:
    ShortcutSettings(QWidget * parent=0);
    void saveTest();
    void assertSaved();
    void cancelTest();
    void assertCancelled();
public slots:
    void buttonSelected();
    void save();
    void cancel();
    virtual void show();
    void updateShortcut(KeyDialog * dialog);
private:
    void initializeButtons();
    void addButton(QString name, QLabel * label, Button * button);
    void addDialog(Button * button);
    void save(QString name, Button * button);
    void loadBindings();
    QString getModifierString(int modifiers);
    Button * changeUp;
    Button * changeDown;
    Button * changeLeft;
    Button * changeRight;
    Button * changeHome;
    Button * changeBack;
    Button * changeNowPlaying;
    Button * changeSelect;
    Button * changeSecondary;
    QLabel * upLabel;
    QLabel * downLabel;
    QLabel * leftLabel;
    QLabel * rightLabel;
    QLabel * volumeUpLabel;
    QLabel * volumeDownLabel;
    QLabel * homeLabel;
    QLabel * backLabel;
    QLabel * nowPlayingLabel;
    QLabel * selectLabel;
    QLabel * secondaryLabel;
    QHash<KeyDialog *, QLabel *> hash;
    Button * saveButton;
    Button * cancelButton;

    Button * volumeUp;
    Button * volumeDown;
    QList<Button *> buttons;
};

#endif // SHORTCUTSETTINGS_H
